<%@include file="/_checkSession.jsp"%>
<%@ page language="java" import="java.util.*, Container.Item, Container.Message, java.text.SimpleDateFormat" pageEncoding="ISO-8859-1"%>

<%
	Item item = (Item)request.getAttribute("item");

	
%> 


<!DOCTYPE html>
<html xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://opengraphprotocol.org/schema/">
<head>
	<style type="text/css">
		body #Body .btn, body #Body c-std {
		filter:none;
		-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#0079bc',endColorstr='#00509d')";
		}
	</style>
	<title> White Samsung Galaxy S 3 Smartphone Unlocked Most Network Worldwide 8806085094536 | eBay</title>
	<link href="http://gh.ebaystatic.com/header/css/all.min?combo=11&amp;siteid=2&amp;rvr=93&amp;factor=REFRESHER&amp;h=22247" type="text/css" rel="stylesheet">
	<link href="http://ir.ebaystatic.com/z/a5/5ssdwbylqq1bhajbymf2j5bwo.css" type="text/css" rel="stylesheet">
	<style type="text/css">
		body ul#bc a {
		                white-space:nowrap;
		}
		body .sz1280 .vi-VR-brumblnkLst{
		                max-width:500px;
		}
		body .sz1152 .vi-VR-brumblnkLst{
		                max-width:450px;
		}
		.sz940 .vi-VR-brumblnkLst{
		                max-width:300px;
		}
		body .sz1280 .vi-bc-topM .vi-VR-brumb-hasNoPrdlnks{
		                max-width:800px;
		}
		body .sz1152 .vi-bc-topM .vi-VR-brumb-hasNoPrdlnks{
		                max-width:750px;
		}
		.sz940 .vi-bc-topM .vi-VR-brumb-hasNoPrdlnks{
		                max-width:550px;
		}
	</style>
	<script type="text/javascript">
    	function validate()
    	{ 
    		var co = document.getElementsByName("co")[0];
    		var bo = document.getElementsByName("bo")[0];
    		var price = document.getElementsByName("price")[0];

    		
    		if(price.value*100<co.value)
    		{
				alert("your bid price less than current offer");
				return false;
    		}
    		
			if (price.value*100>bo.value) {
				alert("your bid price more than buyout price");
                return false;

            } 
    		
    		
    		return true;
    	}
    
    
    </script>
	
	
	
</head>
<body><br><br><br><br><br><br>

	<div id="Body" class="sz940 sz1280" itemscope="itemscope" itemtype="http://schema.org/Product">
		<div id="CenterPanelDF"><br> 
		<div id="CenterPanel" class="ebaylocale_en_CA ">
			<!-- Placement 100011 && 100012 -->
		<div id="CenterPanelInternal">
			<div id="PicturePanel" class="pp-c">
				<div class="pp-ic pp-ic500">
					<div class=" img img500">
						<table class="img img500">
							<tbody><tr><td class="img img500">
								<div id="picturePanelIcon"><br><img id="freeShip" src="http://p.ebaystatic.com/aw/pics/s.gif" alt="FREE shipping" title="FREE shipping" class="picIcon vi-freeShip" style="left:455px;display:none;"></div>
									<a href="javascript:;" style="display: block; cursor: default; text-decoration: none;">
								<div id="mainImgHldr" style="width: 500px; cursor: pointer;" title="WHITE-SAMSUNG-GALAXY-S-3-Smartphone-Unlocked-most-network-worldwide">
									<img id="icImg" class="img img500" itemprop="image" src=<%=item.getImg() %> style="" clk="0" alt="">
								</div>						
							</td></tr></tbody>
						</table>
					</div>
				</div>
			</div>
			<div><h1 class="it-ttl" itemprop="name" id="itemTitle"> WHITE- SAMSUNG GALAXY S 3 Smartphone (Unlocked) most network worldwide</h1></div>
			<div class="it-rlBr  it-rlBr500 "></div>
			<div id="RightSummaryPanel" class="rsp-c"><br>
				<div style="clear: both;"></div><br>
				<div id="rtm_html_1527" style="width: 300px; height: 265px; overflow: hidden; display: block;"><br></div>
			</div> 	
			<div id="LeftSummaryPanel" class="lsp-c lsp-cRight  lsp-cL500 ">
				<div class="is " style="overflow:hidden;">
					
						<div class="nonActPanel">
							<div>
								<div class="u-flL lable">Item id:</div>
								<div class="u-flL condText"><%=item.getIid() %></div>
							</div>
							<div class="u-cb spcr"></div>						
							<div>
								<div class="u-flL lable">Item name:</div>
								<div class="u-flL condText"><%=item.getName() %></div>
							</div>
							<div class="u-cb spcr"></div>
							<div>
								<div class="u-flL lable">Seller name:</div>
								<div class="u-flL condText"><%=item.getSeller() %></div>
							</div>
							<div class="u-cb spcr"></div>
							<div>
								<div class="u-flL lable">End time:</div>
								<%SimpleDateFormat format = new SimpleDateFormat("MM dd yyyy, HH:mm:ss"); %>
								<div class="u-flL condText"><%=format.format(item.getEnd()) %></div>
							</div>
							<div class="u-cb spcr"></div>

						</div>
						<div class="actPanel">			
							<div class="u-cb spcr"></div>
							
							
							
							
							
							
							<form action="RequestProcess" method="post" enctype="multipart/form-data">						
								<div class="u-cb">
									<div class="u-flL lable binLable" id="prcIsum-lbl">Price:</div>
									<div id="vi-mskumap-none" style="" class="u-flL w29 vi-price" itemprop="offers" itemscope="itemscope" itemtype="http://schema.org/Offer">						
										<span class="notranslate" id="prcIsum" itemprop="price" style="">C $<%=item.getBo()/100.0 %></span>
										<span itemprop="availability" content="http://schema.org/OnlineOnly"></span>
										<span itemprop="priceCurrency" content="CAD"></span>
										<input type="hidden" name="uid" value=<%= session.getAttribute("uid") %>>
            							<input type="hidden" name="sid" value=<%= session.getAttribute("sid") %>>
           								<input type="hidden" name="type" value="buyout">
           								<input type="hidden" name="iid" value=<%= item.getIid() %>>
									</div>
									<div class="u-flL">
										<button type="submit" class="btn btn-primary">Buy it Now</button>
									</div>
								</div>	
							</form>
															
							<div class="u-cb spcr"></div>

							<form onsubmit="return validate()" action="RequestProcess" method="post" enctype="multipart/form-data">
								<div class="u-cb">
									<div class="u-flL lable binLable" id="prcIsum-lbl">Price:</div>
									<div id="vi-mskumap-none" style="" class="u-flL w29 vi-price" itemprop="offers" itemscope="itemscope" itemtype="http://schema.org/Offer">						
										<span class="notranslate" id="prcIsum" itemprop="price" style="">
											<input type="text" name="price" placeholder="Current Offer C $ <%=item.getCo()/100.0 %>">
										</span>
										<input type="hidden" name="uid" value=<%= session.getAttribute("uid") %>>
            							<input type="hidden" name="sid" value=<%= session.getAttribute("sid") %>>
           								<input type="hidden" name="type" value="bid">
           								<input type="hidden" name="iid" value=<%= item.getIid() %>>
           								
           								
           								<input type="hidden" name="co" value=<%=item.getCo() %>>
										<input type="hidden" name="bo" value=<%=item.getBo() %>>
										
										
										<span itemprop="availability" content="http://schema.org/OnlineOnly"></span>
										<span itemprop="priceCurrency" content="CAD"></span>
									</div>
									<div class="u-flL">
										<button type="submit" class="btn btn-primary">Bid</button>
									</div>
								</div>
								<div class="u-cb spcr"></div>
							</form>
							
							
							
							
							
							
						</div>
					
				</div>
			</div>
		</div>
	
	
	
	
		<div id="BottomPanelDF">&nbsp;&nbsp; 
			<div id="BottomPanel">
				<div id="rwid" class="pr"> 
					<div class="trr c3" id="v4-0"> 
						<span> 
							<div class="trrtopln"><div class="trrtl"><h2 class="mg f17">Comments</h2></div></div> 
							
							
<%
if(!item.getComment().isEmpty()){
	ArrayList<Message> msgList = (ArrayList<Message>)item.getComment();
	Iterator<Message> it = msgList.iterator();

	while(it.hasNext()){ 
		Message msg = it.next();

%>
							
							
							<div itemprop="reviews" itemscope="itemscope" itemtype="http://schema.org/Review" class="sgrv spln"> 
								<div class="trrln spcln"> 
								<%SimpleDateFormat format2 = new SimpleDateFormat("MM dd yyyy, HH:mm:ss"); %>
									<div class="trrrt trrcttm">Review created: <%=format.format(msg.getDate()) %><span itemprop="datePublished" content="2012-08-01"></span></div>
								</div> 
								<div class="trrln spcln"> 
									<div> by: <div class="mbg"><span class="mbg-nw"><%=msg.getUsername() %></span> <span class="mbg-l"> <b class="g-hdn">Feedback Score Of</b> </span><span class="mbg-l"></span></div><span itemprop="author" content="roygutgon75"></span></div> 
								</div> 
								<div itemprop="reviewBody" class="sgrvctt spcln"><%=msg.getComment() %><div class="sp">&nbsp;</div></div> 
							</div> 
							
<%	} 
}%>
											
						</span>
					</div>
				</div>
			</div> 
		</div>
		
		
        <form class="navbar-form" action="RequestProcess" method="post" enctype="multipart/form-data">
           	<textarea rows="5" name="comment" cols="200"></textarea><br>
            <input type="hidden" name="uid" value=<%= session.getAttribute("uid") %>>
            <input type="hidden" name="sid" value=<%= session.getAttribute("sid") %>>
           	<input type="hidden" name="type" value="comment">
           	<input type="hidden" name="iid" value=<%= item.getIid() %>>
            <button type="submit" class="btn btn-primary">Comment</button>
        </form> 
		
		
	</div>				
		</div>
	</div>
</div>
<link href="http://ir.ebaystatic.com/z/uy/wcnxxfthlq5mrgk4bbp00ounh.css" type="text/css" rel="stylesheet">
<link href="http://ir.ebaystatic.com/z/2t/z0vyqyhdp2zgzogiufqbtyeeo.css" type="text/css" rel="stylesheet">
<link href="http://ir.ebaystatic.com/z/ub/cpazcnmt2u0pfpyqbvqspvnq0.css" type="text/css" rel="stylesheet">
<link href="http://ir.ebaystatic.com/z/ip/2vfaazjvna3bzgvnyfyzw5b4a.css" type="text/css" rel="stylesheet">
</body>
</html>